﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagedList<JLL.China.Model.Listings>>" %>
<%@ Import Namespace="JLL.China.Web.Libraries" %>
 <form id="mainformpending" class="list_item_form" method="post">
<table border="0" width="100%" cellpadding="0" cellspacing="0" class="grid" id="product-table">
<caption class="pending">Pending Post Properties (<%=this.Model.Count%>)</caption>
    <tr>
        <th class="table-header-check">
            <a id="toggle-all-pending" ></a>
        </th>
        <th class="table-header-repeat line-left" style="min-width: 88px !important">
            <a href="">Image</a>
        </th>
        <th class="table-header-repeat line-left" style="min-width: 158px;">
            <a href="">Listing Information</a>
        </th>
        <th class="table-header-repeat line-left" style="min-width: 165px;">
            <a href="">Admin Info</a>
        </th>
        <th style="min-width: 15px;" class="table-header-repeat line-left"><a>Option</a></th>
       
    </tr>
    
   <% foreach (var item in Model)
               {%>
            <tr>
                <td valign="middle"  align="center">
                    <input name="selected" type="checkbox" value="<%=item.ID%>" />
                </td>
                <td style="padding:8px">
                <b>Listing For :</b> <%=item.PropertyFor%><br />
                    <a class="thumbnail">
                        <img src="<%=Url.Content("~/")%>Ajax/ShowImage/<%=item.ID%>" /></a>
                        <br />
                      <b>Listing ID:  </b> <%=item.ID %>
                </td> 
                <td valign="top">
                <ul class="location-listing">
                <li><b>Project name:</b> <%=item.ProjectName%></li>
                <li><b>City:</b> <%=item.City%></li>
                <li><b>Location:</b><%=item.Location%></li>
                <% if (item.SubArea != null)
                   { %>
                <li><b>Subarea:</b><%=item.SubArea%></li>
                <%} %>
                 
                </ul>
                                       
                </td>
               
                <td valign="top"> 
                   <ul class="location-listing">
                   <li><b>Property Type:</b> <%=item.PropertyTypeName%></li>
                    <li><b>Asking Price:</b>  <%= String.Format("{0:#,##0}", item.AskingPriceLocal)%> RMB</li> 
                    <li><b>Area: </b> <%=String.Format("{0:#,##0}", item.FloorArea_SM)%> sqm</li> 
                    <li><b>Creat by:</b> Public</li>
                    <li><b>Create date:</b><%=item.CreateDate.Value.ToShortDateString()%> <%//=item.CreateDate.Value.ToShortTimeString()%></li> 
                    <li><b>Listing date:</b> <%=item.CreateDate.Value.ToShortDateString()%> <%//=tem.CreateDate.Value.ToShortTimeString()%> </li>    
                    </ul>  
                
                  
                </td>
                <td style="text-align:center">
<a href="<%=Url.Content("~/Home/")%>Approve/<%=item.ID%>" class="post-approve" title="Approve">
<img id="detail-icon-img" src="<%=Url.Content("~/Content/images/")%>Star_full.png" style="width: 28px;"></a>
<br/><br/>

<a href="#whyrejet" class="post-rejected" title="Rejected" id="<%=item.ID%>" onclick='$("#PropertyID").val(this.id);' >
<img id="detail-icon-img" src="<%=Url.Content("~/Content/images/")%>Close.png" style="width: 24px;"></a>
<br/><br/>

<a href="<%=Url.Content("~/Listings/")%>Post/Step1/<%=item.ID%>" class="post-edit" title="Edit">
<img id="detail-icon-img" src="<%=Url.Content("~/Content/images/")%>File_edit.png"  style="width: 25px; margin-left: 4px;"></a>
<br /><br/>
<a href="<%=JLL.China.Web.Libraries.HelperUtility.PortalUrl()%>listing/detail/sqm/<%=item.ID%>" class="preview" data-fancybox-type="iframe" title="Preview">
<img alt="search icon" src="<%=Url.Content("~/Content/images/")%>Search.png"  style="width: 28px;">
</a>
</td>
                
            </tr>
            <%} %>
</table>
    <!--  start actions-box ............................................... -->
        <div id="actions-box">
        <a href="" class="iconaction icon-cog"> </a>
            <a href="" class="action-slider"></a>
            <div id="actions-box-slider">
               <a class="iconaction icon-ok-circle"></a>
                <a href="<%=Url.Content("~/Home/")%>Approve"
                    title="Set selected status to Approve" class="action-edit action-invoke info-tooltip">
                    Approve</a>
                <a class="iconaction  icon-minus-sign"></a>
                <a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>BulkProcess/Draft"
                    title="Set selected status to Reject" class="action-edit  action-invoke info-tooltip">
                    Reject</a>
               
            </div>
            <div class="clear">
            </div>
        </div>
        <!-- end actions-box........... -->
        <!--  start paging..................................................... -->
        <table border="0" cellpadding="0" cellspacing="0" id="paging-table">
            <tr>
                <td class="page-cell">
                    <div class="pager">
                        <%= Html.Pager(ViewData.Model.PageSize, ViewData.Model.PageNumber, ViewData.Model.TotalItemCount, new { Module ="Pending" })%>
                    </div>
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                    <%Html.RenderPartial("PerPage", ViewData);%>
                </td>
            </tr>
        </table>
        <!--  end paging................ -->
        <div id="whyrejet" style="display:none;width:400px;">
          
            <h2>
            <fom name="fcontent" id="fcontent">
            <input name="PropertyID" type="hidden" id="PropertyID" />
	    	<p id="login_error">Please, enter the reason why do you want to reject this property.</p>
		<p>
		
			<textarea id="contentwhy" name="contentwhy"  rows='5' cols='47' data-bind="value: contentReject"></textarea>
			<p style="display:none;color:Red" class="errors">Please input the reason. </p>
		</p>
		
		<p style="text-align:center">
			<input type="button"  data-bind="click:save"  class="buttons" value="Ok" />
			<input type="button" data-bind="click:cancel"  class="buttons" value="Cancle"  />
		</p>
		</fom>
	</h2>
			
			
		</div>
</form>